import {ZAN_JIA, ZAN_JIAN} from '../constants';
// import store from '../store';
//封装异步修改状态的 action 函数
export function asyncJiaAction(data){
    return dispatch => {
        //定时器
        setTimeout(() => {
            //修改状态
            dispatch(jiaAction(data));
        }, 1000);
    }
}

//封装创建 action 对象的函数
export function jiaAction(data){
    return {type: ZAN_JIA, data: data}
}

export function jianAction(data){
    return {type: ZAN_JIAN, data};
}